import request from '@/utils/request'

export function fetchArticle(data) {
  return request({
    url: '/system/article/list',
    method: 'post',
    data
  })
}
export function info(id) {
  return request({
    url: '/system/article/info',
    method: 'get',
    params:{
      id:id
    }
  })
}
export function save(data) {
  return request({
    url: '/system/article/add',
    method: 'post',
    data
  })
}
export function update(data) {
  return request({
    url: '/system/article/update',
    method: 'post',
    data
  })
}
export function top(data) {
  return request({
    url: '/system/article/top',
    method: 'post',
    data
  })
}
export function pubOrShelf(data) {
  return request({
    url: '/system/article/pubOrShelf',
    method: 'post',
    data
  })
}
export function remove(id) {
  return request({
    url: '/system/article/delete',
    method: 'delete',
    params:{
      id:id
    }
  })
}
export function deleteBatch(data) {
  return request({
    url: '/system/article/deleteBatch',
    method: 'delete',
    data
  })
}
export function baiduSeo(data) {
  return request({
    url: '/system/article/baiduSeo',
    method: 'post',
    data
  })
}
export function reptile(url) {
  return request({
    url: '/system/article/reptile',
    method: 'get',
    params:{
      url:url
    }
  })
}
export function randomImg() {
  return request({
    url: '/system/article/randomImg',
    method: 'get',
    params:{}
  })
}
// 测试给群里发送消息
export function sendGroup(data) {
  return request({
    url: '/system/article/getDaysNews',
    method: 'get',
    data
  })
}
// 测试给好友发送消息
export function sendUsers(data) {
  return request({
    url: '/system/article/sendWechatToUser',
    method: 'get',
    data
  })
}
//获取每日新闻前10条信息，生成图片
export function getDaysNewsConvertImage() {
  return request({
    url: '/system/article/getDaysNewsConvertImage',
    method: 'get',
  })
}

//获取每日新闻
export function getGoodMorning(tx_key) {
  return request({
    url: '/system/article/goodMorning',
    method: 'get',
    params:{
      tx_key:tx_key
    }
  })
}

//获取每日新闻
export function getTodaysInfo() {
  return request({
    url: '/system/article/getTodaysInfo',
    method: 'get'
  })
}
